﻿using System;
using ARC.AliYun.SMSService.Models.DigitalSmsModels;
using ARC.API.ExternalInterface.Models;
using ARC.API.ExternalInterface.Models.AddSign;
using ARC.API.ExternalInterface.Models.AddTemplate;
using ARC.API.ExternalInterface.Models.QuerySign;
using ARC.API.ExternalInterface.Models.SendDetails;
using ARC.API.ExternalInterface.Models.SendSms;
using System.Collections.Generic;
using ARC.Yunpian.SMSService.Models.SimpleSmsModels;
using ARC.YunXinShi.SMSService.Models.SimpleSmsModels;

namespace ARC.API.ExternalInterface.CurrencyInterface
{
    public interface ICurrencyInterfaceSdkSmsClient
    {
        #region 发送普通短信
        /// <summary>
        /// 阿里云发送短信
        /// </summary>
        /// <param name="accessKeyId">accessKeyId</param>
        /// <param name="secret">secret</param>
        /// <param name="phoneNumber">电话号码</param>
        /// <param name="signName">签名名称</param>
        /// <param name="templateCode">模板Code</param>
        /// <param name="templateParam">模板参数</param>
        /// <returns></returns>
        public SendResponse SendAliYunSimpleSms(string accessKeyId, string secret, string phoneNumber, string signName, string templateCode, string templateParam = "");
        /// <summary>
        /// 阿里云批量发送短信
        /// </summary>
        /// <param name="accessKeyId">accessKeyId</param>
        /// <param name="secret">secret</param>
        /// <param name="phoneNumber">多个电话号码</param>
        /// <param name="signName">多个签名名称</param>
        /// <param name="templateCode">模板Code</param>
        /// <param name="templateParam">多个模板参数</param>
        /// <returns></returns>
        public SendResponse SendAliYunSimpleBatch(string accessKeyId, string secret, List<string> phoneNumbers, List<string> signNameJson, string templateCode, List<Dictionary<string, string>> templateParam = null);
        /// <summary>
        /// 制定模板发送
        /// </summary>
        /// <param name="mobile">接收的手机号，不需要带+86 前缀</param>
        /// <param name="tpl_id">模板 id</param>
        /// <param name="tpl_value">变量名和变量值对。请先对您的变量名和变量值分别进行 urlencode 再传递。使用参考：代码示例。 注：模板中有变量时，变量名和变量值都不能为空，模板中没有变量时，赋值 tpl_value=""</param>
        /// <param name="callback_url">短信发送后将向这个地址推送(运营商返回的)</param>
        /// <param name="extend">扩展号。默认不开放，</param>
        /// <param name="uid">用户自定义唯一 id。</param>
        /// <returns></returns>
        public SendResponse SendYunPianSimpleSms(string apikey, string mobile, string tpl_id, string tpl_value = "", string callback_url = "",
            string extend = "", string uid = "");
        /// <summary>
        /// 逐条发送短信
        /// </summary>
        /// <param name="mobile">单条手机号</param>
        /// <param name="text">发送内容</param>
        /// <param name="extend">下发号码扩展号，纯数字</param>
        /// <param name="uid">该条短信在您业务系统内的 ID</param>
        /// <param name="callback_url">短信发送后将向这个地址推送(运营商返回的)</param>
        /// <param name="register">是否为注册验证码短信，如果传入 true，</param>
        /// <param name="mobile_stat">若短信中包含云片短链接，此参数传入 true 将会把短链接替换为目标手机号的专属链接，用于统计哪些号码的机主点击了短信中的链接，可在云片后台查看</param>
        /// <returns></returns>
        public SendResponse SendSearchYunPianSimpleSms(string apikey, string mobile, string text, string extend = "", string uid = "", string callback_url = "", bool register = false,
            bool mobile_stat = true);
        /// <summary>
        /// 制定模板批量发送
        /// </summary>
        /// <param name="mobile">接收的手机号，不需要带+86 前缀</param>
        /// <param name="tpl_id">模板 id</param>
        /// <param name="tpl_value">变量名和变量值对。请先对您的变量名和变量值分别进行 urlencode 再传递。使用参考：代码示例。 注：模板中有变量时，变量名和变量值都不能为空，模板中没有变量时，赋值 tpl_value=""</param>
        /// <param name="callback_url">短信发送后将向这个地址推送(运营商返回的)</param>
        /// <param name="extend">扩展号。默认不开放，</param>
        /// <param name="uid">用户自定义唯一 id。</param>
        /// <returns></returns>
        public SendResponse SendYunPianSimpleBatch(string apikey, string mobile, string tpl_id, string tpl_value);
        /// <summary>
        /// 发送短信
        /// </summary>
        /// <param name="mobile">短信接口同时发送给多个号码时,号码之间用英文半角逗号分隔(,);小灵通需加区号 如:13972827282,13072827282</param>
        /// <param name="content">JSON变量模板发送，传参规则{"key":"value"}JSON格式，key的名字须和申请模板中的变量名一致，多个变量之间以逗号隔开。示例：针对模板“短信验证码{$code}，您正在进行{$product}身份验证，请在10分钟内完成操作！”，传参时需传入{"code":"352333","product":"电商平台"}</param>
        /// <param name="template">	发送变量模板短信时需要填写对应的模板ID号，进入平台-》短信设置-》模板管理</param>
        /// <param name="time">可选项，格式：年月日时分，定时时间到分,共12个数字如定时到2032-10-01 12:01发 time = 203210011201 </param>
        /// <param name="mobileids">可选项该参数用于发送短信收取状态报告用，格式为消息编号+逗号；与接收号码一一对应，可以重复出现多次。消息编号:全部由数字组成接收状态报告的时候用到，该消息编号的格式可就为目标号码+当前时间戳整数，精确到毫秒，确保唯一性。供收取状态报告用 如: 1590049111112869461937;</param>
        /// <returns></returns>
        public SendResponse SendYunXinShiSimpleSms(string uid, string pwd, string mobile, string template, string content = "", string time = "", string mobileids = "");
        /// <summary>
        /// 全文变量模板发送
        /// </summary>
        /// <param name="mobile">短信接口同时发送给多个号码时,号码之间用英文半角逗号分隔(,);小灵通需加区号 如:13972827282,13072827282</param>
        /// <param name="content">发送内容需要进行URL字符标准化转码。{URL字符编码说明:返回字符串，此字符串中除了-_.之外的所有非字母数字字符都将被替换成百分号（%）后跟两位十六进制数，空格则编码为加号（+）}ASP：server.URLEncode("短信内容")PHP：urlencode("短信内容")JAVA：java.net.URLEncoder.encode("短信内容")</param>
        /// <param name="time">可选项，格式：年月日时分，定时时间到分,共12个数字如定时到2032-10-01 12:01发 time = 203210011201 </param>
        /// <returns></returns>
        public SendResponse SendSearchYunXinShiSimpleSms(string uid, string pwd, string mobile, string content, string time = "", string mobileids = "");
        #endregion
        #region 查询短信发记录
        /// <summary>
        /// 短信发送记录和发送状态
        /// </summary>
        /// <param name="accessKeyId">accessKeyId</param>
        /// <param name="secret">secret</param>
        /// <param name="phoneNumber">接收短信的手机号码。</param>
        /// <param name="sendDate">短信发送日期，支持查询最近30天的记录。格式为yyyyMMdd，例如20181225。</param>
        /// <param name="pageSize">分页查看发送记录，指定每页显示的短信记录数量。取值范围为1 ~50</param>
        /// <param name="currentPage">分页查看发送记录，指定发送记录的的当前页码</param>
        public AliYunSendDetailsResponse QuerySendDetails(string accessKeyId, string secret, string phoneNumber,
            string sendDate, int pageSize,
            int currentPage);
        /// <summary>
        /// 查短信发送记录
        /// </summary>
        /// <param name="apikey">apikey</param>
        /// <param name="start_time">短信发送开始时间</param>
        /// <param name="end_time">短信发送结束时间</param>
        /// <param name="mobile">需要查询的手机号</param>
        /// <param name="page_num">页码，默认值为 1</param>
        /// <param name="page_size">每页个数，最大 100 个，默认值为 20</param>
        /// <param name="type"></param>
        /// <returns></returns>
        public QuerySimpleSmsSendedResponse QuerySendDetails(string apikey, string start_time, string end_time, string mobile = "",
            int page_num = 1, int page_size = 20, string type = "");
        /// <summary>
        /// 获取状态短信接口
        /// </summary>
        /// <param name="uid">用户名</param>
        /// <param name="pwd">密码</param>
        /// <returns></returns>
        public SendedSimpleStatusResponse QuerySendDetails(string uid, string pwd);

        #endregion
        #region 创建签名
        /// <summary>
        /// 添加阿里云普通短信签名
        /// </summary>
        /// <param name="accessKeyId">accessKeyId</param>
        /// <param name="secret">secret</param>
        /// <param name="signName">签名名称</param>
        /// <param name="signSource">0：企事业单位的全称或简称。1：工信部备案网站的全称或简称。2：APP应用的全称或简称。3：公众号或小程序的全称或简称。4：电商平台店铺名的全称或简称。5：商标名的全称或简称</param>
        /// <param name="remark">短信签名申请说明。请在申请说明中详细描述您的业务使用场景，申请工信部备案网站的全称或简称请在此处填写域名，长度不超过200个字符</param>
        /// <param name="signFileList">签名文件列表</param>
        public AddSignResponse AddSimpleSign(string accessKeyId, string secret, string signName, string signSource, string remark, Dictionary<string, string> signFileList = null);
        /// <summary>
        /// 添加普通短信签名
        /// </summary>
        /// <param name="apikey">apikey</param>
        /// <param name="sign">签名内容</param>
        /// <param name="notify">是否短信通知结果，默认 true</param>
        /// <param name="apply_vip">是否申请专用通道，默认 false</param>
        /// <param name="is_only_global">	是否仅发国际短信，默认 false</param>
        /// <param name="industry_type">所属行业，默认“其它”</param>
        /// <param name="prove_type">根据签名内容需要提供的证明文件类型，其中：1：公司营业执照(签名是公司名称)；2：应用商店APP管理后台全屏截图(签名是APP名称)；3：ICP备案截图(签名是网站名称)4：微信公众平台管理界面全屏截图(签名是公众号/小程序名称)5：授权委托书(签名为非本账号实名认证的公司、网站、产品名等)6：商标注册证书/商标软著权证明(签名是商标名称)</param>
        /// <param name="license_url">签名对应的营业执照或其他企业资质的图片文件 URL，URL 由请求方提供</param>
        /// <param name="license_base64">签名对应的资质图片进行 base64 编码格式转换后的字符串。此参数和 license_url 您可以任选一种需要的方式进行传输。若两种参数都传，优先取 license_url。</param>
        /// <returns></returns>
        public AddSignResponse AddSimpleSign(string apikey, string sign, long prove_type = 0, string license_url = "", string license_base64 = "", bool notify = true, bool apply_vip = false,
            bool is_only_global = false, string industry_type = "其它");

        #endregion
        #region 查询签名状态
        /// <summary>
        /// 查询单条普通短信签名状态
        /// </summary>
        /// <param name="accessKeyId">accessKeyId</param>
        /// <param name="secret">secret</param>
        /// <param name="signName">签名名称</param>
        /// <returns></returns>
        public QuerySignResponse QuerySimpleSign(string accessKeyId, string secret, string signName);
        /// <summary>
        /// 获取普通短信签名状态
        /// </summary>
        /// <param name="sign">返回所有包含该内容的签名（模糊匹配），若要获取指定签名可加上符号，如【云片网】</param>
        /// <param name="page_num">页码，1 开始，不带或者格式错误返回全部</param>
        /// <param name="page_size">返回条数，必须大于 0，不带或者格式错误返回全部</param>
        /// <returns></returns>
        public List<QuerySignResponse> QuerySimpleSign(string apikey, string sign, int page_num, int page_size);


        #endregion
        #region 删除签名
        /// <summary>
        /// 删除短信签名
        /// </summary>
        /// <param name="accessKeyId">accessKeyId</param>
        /// <param name="secret">secret</param>
        /// <param name="signName">短信签名</param>
        /// <returns></returns>
        public AddSignResponse DeleteSimpleSmsSign(string accessKeyId, string secret, string signName);
        //云片不能删除短信签名
        #endregion
        #region 修改签名

        /// <summary>
        /// 阿里云修改签名
        /// </summary>
        /// <param name="signName"></param>
        /// <param name="signSource"></param>
        /// <param name="remark"></param>
        /// <param name="signFileList"></param>
        /// <returns></returns>
        public AddSignResponse UpdateSimpleSign(string accessKeyId, string secret, string signName, string signSource, string remark,
            Dictionary<string, string> signFileList);
        /// <summary>
        /// 云片修改签名
        /// </summary>
        /// <param name="old_sign"></param>
        /// <param name="sign"></param>
        /// <param name="prove_type"></param>
        /// <param name="license_url"></param>
        /// <param name="license_base64"></param>
        /// <param name="notify"></param>
        /// <param name="apply_vip"></param>
        /// <param name="is_only_global"></param>
        /// <param name="industry_type"></param>
        /// <returns></returns>
        public AddSignResponse UpdateSimpleSign(string apikey, string old_sign, string sign, long prove_type, string license_url,
            string license_base64, bool notify = true, bool apply_vip = false,
            bool is_only_global = false, string industry_type = "其它");

        #endregion
        #region 创建模板
        /// <summary>
        /// 添加阿里云普通短信模板
        /// </summary>
        /// <param name="accessKeyId">accessKeyId</param>
        /// <param name="secret">secret</param>
        /// <param name="templateType">短信类型。其中：0：验证码。1：短信通知。2：推广短信。3：国际/港澳台消息。</param>
        /// <param name="templateName">模板名称</param>
        /// <param name="templateContent">模板内容</param>
        /// <param name="remark">短信模板申请说明</param>
        /// <returns></returns>
        public AddTemplateResponse AddSimpleTemplate(string accessKeyId, string secret, int templateType, string templateName,
            string templateContent, string remark = "");
        /// <summary>
        /// 添加普通短信模板
        /// </summary>
        /// <param name="tpl_content">模板内容，必须以带符号【】的签名开头</param>
        /// <param name="notify_type">审核结果短信通知的方式。其中:0 表示需要通知,默认;1 表示仅审核不通过时通知;2 表示仅审核通过时通知;3 表示不需要通知；</param>
        /// <param name="website">验证码类模板对应的官网注册页面，验证码类模板必填</param>
        /// <param name="tplType">1 代表验证码类模板，验证码类模板必填</param>
        /// <param name="callback">审核结果会向这个地址推送</param>
        /// <param name="apply_description">说明模板的发送场景和对象</param>
        /// <returns></returns>
        public AddTemplateResponse AddSimpleTemplate(string apikey, string tpl_content, int notify_type = 0, string website = "", int tplType = 0, string callback = "", string apply_description = "");
        /// <summary>
        /// 添加普通短信模板
        /// </summary>
        /// <param name="uid">用户名</param>
        /// <param name="pwd">密码</param>
        /// <param name="content">模板内容包含短信内容和签名。全文变量模板的变量用{**}代替，JSON变量模板的变量用源码中相应的变量参数代替。</param>
        /// <param name="type">1.验证码 2.通知 3.推广</param>
        /// <param name="title">模板标题名称用于备注查询[选填]</param>
        /// <param name="dataformat">1.全文变量模板 2.JSON变量模（不填写默认为全文变量模板）[选填]</param>
        /// <returns></returns>
        public AddTemplateResponse AddSimpleTemplate(string uid, string pwd, string content, string type, string title = "", string dataformat = "");

        #endregion
        #region 查询模板状态
        /// <summary>
        /// 查询单条普通短信模板
        /// </summary>
        /// <param name="accessKeyId">accessKeyId</param>
        /// <param name="secret">secret</param>
        /// <param name="templateCode"></param>
        /// <returns></returns>
        public QueryTemplate QuerySimpleTemplate(string accessKeyId, string secret, string templateCode);

        /// <summary>
        /// 制定模板查询状态
        /// </summary>
        /// <param name="tpl_id">模板code</param>
        /// <returns></returns>
        public QueryTemplate QuerySimpleTemplate(string apikey, long tpl_id);
        /// <summary>
        /// 普通短信模板审核状态查询
        /// </summary>
        /// <param name="templateid">模板id</param>
        /// <returns></returns>
        public QueryTemplate QuerySimpleTemplate(string uid, string pwd, string templateid, string nul = "");
        #endregion
        #region 删除模板
        /// <summary>
        /// 删除阿里云短信模板
        /// </summary>
        /// <param name="accessKeyId">accessKeyId</param>
        /// <param name="secret">secret</param>
        /// <param name="templateName">模板名称</param>
        /// <returns></returns>
        public AddTemplateResponse DeleteSimpleTemplate(string accessKeyId, string secret, string templateName);
        /// <summary>
        /// 删除普通短信模板
        /// </summary>
        /// <param name="tpl_id">模板 id，64 位长整形。指定 id 时返回 id 对应的模板。未指定时返回所有模板</param>
        /// <returns></returns>
        public AddTemplateResponse DeleteSimpleTemplate(string apikey, long tpl_id);
        /// <summary>
        /// 删除普通短信模板
        /// </summary>
        /// <param name="uid">用户名</param>
        /// <param name="pwd">密码</param>
        /// <param name="content">模板内容包含短信内容和签名。全文变量模板的变量用{**}代替，JSON变量模板的变量用源码中相应的变量参数代替。</param>
        /// <param name="type">1.验证码 2.通知 3.推广</param>
        /// <param name="delete">delete=1 删除指定模板ID模板</param>
        /// <returns></returns>
        public AddTemplateResponse DeleteSimpleTemplate(string uid, string pwd, string content, string type, string templateId, string delete);
        #endregion

        #region 修改模板
        /// <summary>
        /// 阿里云修改模板
        /// </summary>
        /// <param name="templateType"></param>
        /// <param name="templateName"></param>
        /// <param name="templateCode"></param>
        /// <param name="templateContent"></param>
        /// <param name="remark"></param>
        /// <returns></returns>
        public AddTemplateResponse UpdateSimpleTemplate(string accessKeyId, string secret, int templateType, string templateName,
            string templateCode, string templateContent, string remark);

        /// <summary>
        /// 云片修改模板
        /// </summary>
        /// <param name="tpl_id"></param>
        /// <param name="tpl_content"></param>
        /// <param name="notify_type"></param>
        /// <param name="website"></param>
        /// <param name="tplType"></param>
        /// <param name="callback"></param>
        /// <param name="apply_description"></param>
        /// <returns></returns>
        public AddTemplateResponse UpdateSimpleTemplate(string apikey, long tpl_id, string tpl_content, int notify_type = 0,
            string website = "", int tplType = 0, string callback = "", string apply_description = "");
        /// <summary>
        /// 云信使修改签名
        /// </summary>
        /// <param name="content"></param>
        /// <param name="type"></param>
        /// <param name="templateid"></param>
        /// <returns></returns>
        public AddTemplateResponse UpdateSimpleTemplate(string uid, string pwd, string content, string type, string templateid);


        #endregion
        #region 数字短信
        /// <summary>
        /// 创建数字模板
        /// </summary>
        /// <param name="accessKeyId">accessKeyId</param>
        /// <param name="secret">secret</param>
        /// <param name="templateName">模板名称</param>
        /// <param name="files">文件集合</param>
        /// <param name="remark">备注</param>
        /// <returns></returns>
        public AddTemplateResponse AddAliYunDigitalTemplate(string accessKeyId, string secret, string templateName, List<DigitalSmsAddTemFileArray> files, string remark);
        /// <summary>
        /// 删除数字模板
        /// </summary>
        /// <param name="accessKeyId">accessKeyId</param>
        /// <param name="secret">secret</param>
        /// <param name="templateCode">模板code</param>
        /// <returns></returns>
        public AddTemplateResponse DeleALiYunDigitalTemplate(string accessKeyId, string secret, string templateCode);
        /// <summary>
        /// 短信发送记录和发送状态
        /// </summary>
        /// <param name="accessKeyId">accessKeyId</param>
        /// <param name="secret">secret</param>
        /// <param name="phoneNumber">接收短信的手机号码。</param>
        /// <param name="sendDate">短信发送日期，支持查询最近30天的记录。格式为yyyyMMdd，例如20181225。</param>
        /// <param name="pageSize">分页查看发送记录，指定每页显示的短信记录数量。取值范围为1 ~50</param>
        /// <param name="currentPage">分页查看发送记录，指定发送记录的的当前页码</param>
        public AliYunSendDetailsResponse QueryAliYunDigitalSendDetails(string accessKeyId, string secret, string phoneNumber, string sendDate, int pageSize,
            int currentPage);
        /// <summary>
        /// 阿里云发送数字短信
        /// </summary>
        /// <param name="accessKeyId">accessKeyId</param>
        /// <param name="secret">secret</param>
        /// <param name="phoneNumbers">多个电话号码</param>
        /// <param name="templateCode">模板Code/param>
        /// <param name="templateParam">模板参数</param>
        /// <returns></returns>
        public SendResponse SendALiYunDigitalSms(string accessKeyId, string secret, string phoneNumbers,
            string templateCode, Dictionary<string, string> templateParam = null);
        /// <summary>
        /// 阿里云发送数字短信批量
        /// </summary>
        /// <param name="accessKeyId">accessKeyId</param>
        /// <param name="secret">secret</param>
        /// <param name="phoneNumbers">多个电话号码</param>
        /// <param name="templateCode">模板Code</param>
        /// <param name="templateParam">模板参数</param>
        /// <returns></returns>
        public SendResponse SendALiYunDigitalBatch(string accessKeyId, string secret, List<string> phoneNumbers, string templateCode, List<Dictionary<string, string>> templateParam = null);
        #endregion
    }
}
